#!/bin/bash
#DT=`date -d '-1 day' +%Y-%m-%d`
DT='2023-05-28'

#class_studying_student_count  在读学员人数信息表
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,'${DT}' as dt from class_studying_student_count where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table ods_class_studying_student_count \
-m 1
#course_table_upload_detail  班级排课信息表
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,'${DT}' as dt from course_table_upload_detail where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table ods_course_table_upload_detail \
-m 1
#tbh_class_time_table  班级作息时间表
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,'${DT}' as dt from tbh_class_time_table where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table ods_tbh_class_time_table \
-m 1
#tbh_student_signin_record  学生打卡信息表
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,'${DT}' as dt from tbh_student_signin_record where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table ods_tbh_student_signin_record \
-m 1
#student_leave_apply  学生请假申请表
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://192.168.88.80:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username root \
--password 123456 \
--query "select *,'${DT}' as dt from student_leave_apply where 1=1 and  \$CONDITIONS" \
--hcatalog-database edu_ods \
--hcatalog-table ods_student_leave_apply \
-m 1